package com.example.treasure_back.entity;

import java.util.ArrayList;
import java.util.List;

public class ChatroomEntity {
    public static List<String> chatroom1 = new ArrayList<>();
    public static List<String> chatroom2 = new ArrayList<>();
    public static List<String> chatroom3 = new ArrayList<>();

    public static void addUser(String id ,String userId){
        if (id.equals("1")){
            chatroom1.add(userId);
        }
        else if(id.equals("2")){
            chatroom2.add(userId);
        }
        else {
            chatroom3.add(userId);
        }
    }

    public static void removeUser(String id ,String userId){
        if (id.equals("1")){
            chatroom1.remove(userId);
        }
        else if(id.equals("2")){
            chatroom2.remove(userId);
        }
        else {
            chatroom3.remove(userId);
        }
    }

    public static List<String> getUsers(String id){
        if (id.equals("1")){
            return chatroom1;
        }
        else if(id.equals("2")){
            return chatroom2;
        }
        else {
            return chatroom3;
        }
    }
}
